Extended Report: The Implicit Calculus
نویسندگان
چکیده
Generic programming (GP) is an increasingly important trend in programming languages. Well-known GP mechanisms, such as type classes and the C++0x concepts proposal, usually combine two features: 1) a special type of interfaces; and 2) implicit instantiation of implementations of those interfaces. Scala implicits are a GP language mechanism, inspired by type classes, that break with the tradition of coupling implicit instantiation with a special type of interface. Instead, implicits provide only implicit instantiation, which is generalized to work for any types. This turns out to be quite powerful and useful to address many limitations that show up in other GP mechanisms. This paper synthesizes the key ideas of implicits formally in a minimal and general core calculus called the implicit calculus (λ⇒), and it shows how to build source languages supporting implicit instantiation on top of it. A novelty of the calculus is its support for partial resolution and higher-order rules (a feature that has been proposed before, but was never formalized or implemented). Ultimately, the implicit calculus provides a formal model of implicits, which can be used by language designers to study and inform implementations of similar mechanisms in their own languages.
منابع مشابه
On Conservativity of Concurrent Haskell
The calculus CHF models Concurrent Haskell extended by concurrent, implicit futures. It is a lambda and process calculus with concurrent threads, monadic concurrent evaluation, and includes a pure functional lambda-calculus PF which comprises data constructors, caseexpressions, letrec-expressions, and Haskell’s seq. Our main result is conservativity of CHF as extension of PF. This allows us to ...
متن کاملImplicit Schemes for Solving Extended General Nonconvex Variational Inequalities
We suggest and analyze some implicit iterative methods for solving the extended general nonconvex variational inequalities using the projection technique. We show that the convergence of these iterative methods requires only the gh-pseudomonotonicity, which is a weaker condition than gh-monotonicity. We also discuss several special cases. Our method of proof is very simple as compared with othe...
متن کاملA Calculus of Constructions with Explicit Subtyping
The calculus of constructions can be extended with an infinite hierarchy of universes and cumulative subtyping. Subtyping is usually left implicit in the typing rules. We present an alternative version of the calculus of constructions where subtyping is explicit. We avoid problems related to coercions and dependent types by using the Tarski style of universes and by adding equations to reflect ...
متن کاملAn abstract machine for concurrent haskell with futures
We show how Sestoft’s abstract machine for lazy evaluation of purely functional programs can be extended to evaluate expressions of the calculus CHF – a process calculus that models Concurrent Haskell extended by imperative and implicit futures. The abstract machine is modularly constructed by first adding monadic IO-actions to the machine and then in a second step we add concurrency. Our main ...
متن کاملStrong Normalization of Herbelin's Explicit Substitution Calculus with Substitution Propagation
Herbelin presented (at CSL'94) a simple sequent calculus for minimal implicational logic, extensible to full rst-order intuitionistic logic, with a complete system of cut-reduction rules which is both con uent and strongly normalising. Some of the cut rules may be regarded as rules to construct explicit substitutions. He observed that the addition of a cut permutation rule, for propagation of s...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- CoRR
دوره abs/1203.4499 شماره
صفحات -
تاریخ انتشار 2012